feat: felt OCR — three approaches to character recognition by shape qualia#86
Merged
Merged
Conversation
…ualia Three recognition methods compared on synthetic glyphs: 1. Base17/JL (34 bytes/glyph): golden-step projection to 17D, L1 codebook → B-n=38939 (closest: share vertical+bump shape), A-B=43001 2. Polar quantization (8 bytes/glyph): 16 angles × 4 radii, rotation-invariant → B-n=10 (lowest!), Q-I=10, m-n=11, m-z=11 3. BGZ17 palette (1 byte/glyph): 256×256 distance table, O(1) lookup → B-n=87 (lowest), A-B=96, O-z=104 All three agree: B feels like n (vertical stroke + bump). The system discovers character relationships without being told. Plus: - Euler-γ fast skew: γ/(γ+1)≈0.366 signal floor, skip search for straight pages - Indent-based paragraph detection: first-pixel margin analysis - Synthetic glyph renderer for codebook bootstrapping - CharCodebook: 256 entries, recognize() returns (char, distance, confidence) For production: use ocrs+rten (AdaWorldAPI/ocrs + AdaWorldAPI/rten). This module is the felt-distance fast path: no neural net, pure lookup. 10 tests passing. https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: felt OCR — three approaches to character recognition by shape qualia
Three recognition methods compared on synthetic glyphs:
Base17/JL (34 bytes/glyph): golden-step projection to 17D, L1 codebook
→ B-n=38939 (closest: share vertical+bump shape), A-B=43001
Polar quantization (8 bytes/glyph): 16 angles × 4 radii, rotation-invariant
→ B-n=10 (lowest!), Q-I=10, m-n=11, m-z=11
BGZ17 palette (1 byte/glyph): 256×256 distance table, O(1) lookup
→ B-n=87 (lowest), A-B=96, O-z=104
All three agree: B feels like n (vertical stroke + bump). The system
discovers character relationships without being told.
Plus:
For production: use ocrs+rten (AdaWorldAPI/ocrs + AdaWorldAPI/rten).
This module is the felt-distance fast path: no neural net, pure lookup.
10 tests passing.
https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp